﻿using Tao.OpenGl;

namespace GameStateDemo
{
    public class SplashScreenState : IGameObject
    {
        readonly StateSystem _system;
        double _delayInSeconds = 3;

        public SplashScreenState(StateSystem system)
        {
            _system = system;
        }

        public void Update(double elapsedTime)
        {
            _delayInSeconds -= elapsedTime;
            if (!(_delayInSeconds <= 0)) return;
            _delayInSeconds = 3;
            _system.ChangeState("title_menu");
        }

        public void Render()
        {
            Gl.glClearColor(1, 1, 1, 1);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
            Gl.glFinish();
        }
    }
}